# middleware.py
class NgrokSkipWarningMiddleware:
    def __init__(self, get_response):
        self.get_response = get_response
    def __call__(self, request):
        request.META['ngrok-skip-browser-warning'] = '1'  # 添加请求头
        response = self.get_response(request)
        return response